﻿<%@ Page Title="Consulta Movtos" Language="VB" MasterPageFile="~/masterpages/MaestraEmpadres.master" AutoEventWireup="false" CodeFile="Movtos.aspx.vb" Inherits="Empadres_Movtos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="../Estilos/formulario.css" rel="Stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <center>
        <table width="40%" style="font-family: Calibri, Arial; font-weight: bold; font-size: 16px">
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td class="FormHeaderTD">
                <asp:Label ID="lblTitulo" runat="server" Text="CONSULTA  MOVIMIENTOS" ></asp:Label> </td>
            </tr>
        </table>
    </center>

    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization ="true" >
    </ajaxToolkit:ToolkitScriptManager>

    <asp:ObjectDataSource ID="odsUbicacion" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetCatGralBycattip" 
        TypeName="DataSet_ohlTableAdapters.catalogo_generalTableAdapter">
        <SelectParameters>
            <asp:Parameter DefaultValue="U" Name="cattip" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <br /> 
    <asp:RadioButtonList ID="rbtPrincipal" runat="server" RepeatDirection="Horizontal" 
        CssClass = "FieldCaptionTD" AutoPostBack="True" >
        <asp:ListItem Value="M">MOVIMIENTOS</asp:ListItem>
        <asp:ListItem Value="E">ESTADO</asp:ListItem>
    </asp:RadioButtonList>

    <br /> <br /> 
    <asp:Panel ID="pnlMovtos" runat="server" style="POSITION: relative; TOP: 0px; LEFT: 0px;">
    
    <div style=" width :100%">
        <div style=" width:65%; position:relative; float :left; border-style:double ">
        <div style=" width:38%; position:relative; float :left; ">
            <br />
            <table id="tblBuscar1">
            <tr>
                <td class="FormHeaderTD" align="center" > BUSCAR POR</td>
                <td> &nbsp; </td>
            </tr>
            <tr>
                <td> &nbsp; </td> <td> &nbsp; </td>
            </tr>
            <tr>
                <td> <asp:RadioButtonList ID="rbtMovtos" runat="server" RepeatDirection="Vertical" CssClass = "FieldCaptionTD" Width = "120px" >
                    <asp:ListItem Value="1">Animal</asp:ListItem>
                    <asp:ListItem Value="2">Fechas</asp:ListItem>
                    <asp:ListItem Value="3">Ubicacion</asp:ListItem>
                    <asp:ListItem Value="4">Origen</asp:ListItem>
                    </asp:RadioButtonList> </td>
                <td> &nbsp; </td>
            </tr>
            <tr> <td> &nbsp; </td> <td> &nbsp; </td> </tr>
            <tr>
                <td> <asp:Button ID="btnConsulta" runat="server" Text="Consulta" TabIndex="8" 
                        CssClass="Botones" /> </td>
                <td> &nbsp; </td> 
            </tr>
            <tr> <td> &nbsp; </td> <td> &nbsp; </td> </tr>
            </table>
        </div>
    
        <div style=" width:60%; position:relative ; float : right; ">
            <br />
            <table id="tblMovtos">
            <tr>
                <td class="FormHeaderTD" align="center" > DATOS</td>
                <td> &nbsp; </td>
                <td ><asp:Label ID="lblId" runat="server" Visible="False"></asp:Label></td>
            </tr>
            <tr>
                <td> &nbsp; </td> <td> &nbsp; </td> <td> &nbsp; </td>
            </tr>
            <tr>
                <td class="FieldCaptionTD" align="left" > Animal :</td>
                <td> 
                    <asp:TextBox ID="txtAnimal" runat="server" MaxLength="10" TabIndex="1" Width="80px" 
                    BorderWidth="1px" ToolTip="Clave Animal" ReadOnly="True"></asp:TextBox> </td>
                <td ><asp:Label ID="lblNomAni" runat="server" Visible="True"></asp:Label></td>
            </tr>
            <tr>
                <td class="FieldCaptionTD" align="left" > Fechas :</td>
                <td> 
                    <asp:TextBox ID="txtFI" runat="server" MaxLength="10" TabIndex="2" 
                    BorderWidth="1px" Width="80px" ToolTip="Fecha Inicial" /> 

                    <asp:ImageButton ID="ImgBntCal1" runat="server" CausesValidation="False" 
                        ImageUrl="~/images/Calendar_scheduleHS.png" TabIndex="6" 
                        ImageAlign ="Right" />
                        
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtFI" 
                        Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" ErrorTooltipEnabled="True"
                        MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtFI" 
                        PopupButtonID="ImgBntCal1" TodaysDateFormat="dd-MM-yyyy" />
                    <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
                        ControlToValidate="txtFI" Display="Dynamic" TooltipMessage="dd/mm/aaaa"  ErrorMessage="ERROR"
                        EmptyValueMessage="La fecha es requerida" EmptyValueBlurredText="Fecha requerida" ValidationGroup="MKE"
                        InvalidValueMessage="Fecha Invalida" InvalidValueBlurredMessage="Fecha invalida" ForeColor="Maroon" />
                </td>
                <td> <asp:TextBox ID="txtFF" runat="server" MaxLength="10" TabIndex="3" 
                    BorderWidth="1px" Width="80px" ToolTip="Fecha Final" /> 
                    
                    <asp:ImageButton ID="ImgBntCal2" runat="server" CausesValidation="False" 
                        ImageUrl="~/images/Calendar_scheduleHS.png" TabIndex="7" 
                        ImageAlign ="Right" />
                        
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtFF" 
                        Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" ErrorTooltipEnabled="True"
                        MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtFF" 
                        PopupButtonID="ImgBntCal2" TodaysDateFormat="dd-MM-yyyy" />
                    <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server" ControlExtender="MaskedEditExtender2"
                        ControlToValidate="txtFF" Display="Dynamic" TooltipMessage="dd/mm/aaaa"  ErrorMessage="ERROR"
                        EmptyValueMessage="La fecha es requerida" EmptyValueBlurredText="Fecha requerida" ValidationGroup="MKE"
                        InvalidValueMessage="Fecha Invalida" InvalidValueBlurredMessage="Fecha invalida" ForeColor="Maroon" />
                </td>
            </tr>
            <tr>
                <td class="FieldCaptionTD" align="left" > Ubicacion :</td>
                <td colspan="2">
                    <asp:DropDownList ID="ddlUbicacion" runat="server" AppendDataBoundItems="True" 
                        DataSourceID="odsUbicacion" DataTextField="catnom" 
                        DataValueField="catcve" ToolTip="Selecciona la ubicación" TabIndex="4">
                    <asp:ListItem Selected="True"></asp:ListItem></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="FieldCaptionTD" align="left" > Origen :</td>
                <td colspan="2"> <asp:DropDownList ID="ddlEstatus" runat="server"  AppendDataBoundItems="True"
                    style="height: 22px" Height="24px" ToolTip="Selecciona la estatus" TabIndex="5">
                    <asp:ListItem Text = ""             Value=""> </asp:ListItem>
                    <asp:ListItem Text = "Empadre"      Value="E"> </asp:ListItem>
                    <asp:ListItem Text = "General"      Value="G"></asp:ListItem>
                    <asp:ListItem Text = "Ubicaciones"  Value="U"></asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            </table>
        </div>
        </div>

        <div style=" width:30%; position:relative; float:right;">
            <table id="tblAnimal">
            <tr>
                <td valign="top">
                    <asp:GridView ID="gvAnimal" runat="server" 
                    AutoGenerateColumns="False" CellPadding="4" ToolTip="Elija Animal" 
                    RowStyle-HorizontalAlign="Left" PageSize="300" ForeColor="#333333" 
                        GridLines="None">
                    <PagerSettings PageButtonCount="20" Position="TopAndBottom" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <Columns>
                        <asp:CommandField ButtonType="Image" ShowSelectButton="True" SelectImageUrl="~/images/check14x13_blue.png" />
                        <asp:BoundField HeaderText="ANIMAL" DataField="Animal" />
                        <asp:BoundField HeaderText="ID" DataField="animalID" />
                        <asp:BoundField HeaderText="NOMBRE" DataField="nombre" />
                        <asp:BoundField HeaderText="VECES" DataField="veces" />
                    </Columns>
                    <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="true" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"/>
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    </asp:GridView>
                </td>
            </tr>
            </table>
        </div>

        <div style=" position:relative; float :left; ">
            <br />
            <asp:Label ID="lblFiltro1" runat="server" Text="MOVIMIENTOS" CssClass="FormHeaderTD" ></asp:Label> 
            <br /> <br />
            <asp:GridView ID="gvMovtos1" runat="server" 
            AutoGenerateColumns="False" CellPadding="4"  
            RowStyle-HorizontalAlign="Left" PageSize="300" ForeColor="#333333" GridLines="None">
            <PagerSettings PageButtonCount="20" Position="TopAndBottom" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField HeaderText="ANIMAL" DataField="Animal" />
                <asp:BoundField HeaderText="ID" DataField="animalID" Visible="False" />
                <asp:BoundField HeaderText="NOMBRE" DataField ="NomAni" />
                <asp:BoundField HeaderText="CAPTURA" DataField="f_captura" Visible="False" />
                <asp:BoundField HeaderText="MOVTO" DataField="f_movto" DataFormatString="&quot;{0:d}&quot;" />
                <asp:BoundField HeaderText="GAN/COR" DataField="gan_cor" />
                <asp:BoundField HeaderText="UBICACION" DataField="NomUbi" />
                <asp:BoundField HeaderText="# EMP" DataField="empadre" Visible ="False" />
                <asp:BoundField HeaderText="USUARIO" DataField="usuario" Visible="False" />
                <asp:BoundField HeaderText="ORIGEN DEL MOVTO." DataField="estatus" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="true" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"/>
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:GridView>
        </div>
    
    </div>

    </asp:Panel>

    <asp:Panel ID="pnlEstado" runat="server" style="POSITION: relative; TOP: 0px; LEFT: 0px;">
    
    <div style=" width :100%; ">
        <div style=" width:90%; position:relative; float :left; border-style:double ">
        <div style=" width:45%; position:relative; float :left; ">
            <br />
            <table id="tblBuscar2">
            <tr>
                <td class="FormHeaderTD" align="center" > ESTADO POR</td>
                <td> &nbsp; </td>
            </tr>
            <tr>
                <td> &nbsp; </td> <td> &nbsp; </td>
            </tr>
            <tr>
                <td> <asp:RadioButtonList ID="rbtEstado" runat="server" RepeatDirection="Vertical" CssClass = "FieldCaptionTD" Width = "300px" >
                    <asp:ListItem Value="1">Ubicacion (Actual)</asp:ListItem>
                    <asp:ListItem Value="2">Todas las Ubicaciones (Actual)</asp:ListItem>
                    <asp:ListItem Value="3">Ubicacion y Fecha</asp:ListItem>
                    <asp:ListItem Value="4">Todas Ubicaciones y Fecha</asp:ListItem>
                    </asp:RadioButtonList> </td>
                <td> &nbsp; </td>
            </tr>
            <tr> <td> &nbsp; </td> <td> &nbsp; </td> </tr>
            <tr>
                <td> <asp:Button ID="btnEstado" runat="server" Text="Consulta" TabIndex="8" 
                        CssClass="Botones" /> </td>
                <td> &nbsp; </td> 
            </tr>
            <tr> <td> &nbsp; </td> <td> &nbsp; </td> </tr>
            </table>
        </div>
    
        <div style=" width:45%; position:relative ; float : right; ">
            <br />
            <table id="tblEstado">
            <tr>
                <td class="FormHeaderTD" align="center" > DATOS</td>
                <td> &nbsp; </td>
                <td ><asp:Label ID="lblId2" runat="server" Visible="False"></asp:Label></td>
            </tr>
            <tr>
                <td> &nbsp; </td> <td> &nbsp; </td> <td> &nbsp; </td>
            </tr>
            <tr>
                <td class="FieldCaptionTD" align="left" > Ubicacion :</td>
                <td colspan="2">
                    <asp:DropDownList ID="ddlUbicacion2" runat="server" AppendDataBoundItems="True" 
                        DataSourceID="odsUbicacion" DataTextField="catnom" 
                        DataValueField="catcve" ToolTip="Selecciona la ubicación" TabIndex="4">
                    <asp:ListItem Selected="True"></asp:ListItem></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td> &nbsp; </td> <td> &nbsp; </td> <td> &nbsp; </td>
            </tr>
            <tr>
                <td class="FieldCaptionTD" align="left" > Fecha :</td>
                <td> 
                    <asp:TextBox ID="txtFecha" runat="server" MaxLength="10" TabIndex="2" 
                    BorderWidth="1px" Width="80px" ToolTip="Fecha Inicial" /> 

                    <asp:ImageButton ID="ImgBntCal3" runat="server" CausesValidation="False" 
                        ImageUrl="~/images/Calendar_scheduleHS.png" TabIndex="6" 
                        ImageAlign ="Right" />
                        
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtFecha" 
                        Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" ErrorTooltipEnabled="True"
                        MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtFecha" 
                        PopupButtonID="ImgBntCal3" TodaysDateFormat="dd-MM-yyyy" />
                    <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator3" runat="server" ControlExtender="MaskedEditExtender3"
                        ControlToValidate="txtFecha" Display="Dynamic" TooltipMessage="dd/mm/aaaa"  ErrorMessage="ERROR"
                        EmptyValueMessage="La fecha es requerida" EmptyValueBlurredText="Fecha requerida" ValidationGroup="MKE"
                        InvalidValueMessage="Fecha Invalida" InvalidValueBlurredMessage="Fecha invalida" ForeColor="Maroon" />
                </td>
                <td> &nbsp; </td>
            </tr>
            <tr>
                <td> &nbsp; </td> <td> &nbsp; </td> <td> &nbsp; </td>
            </tr>
            </table>
        </div>
        </div>

        <div style=" position:relative; float :left; ">
            <br /> <br /> 
            <asp:Label ID="lblFiltro2" runat="server" Text="MOVIMIENTOS" CssClass="FormHeaderTD" ></asp:Label> 
            <br /> <br /> 
            <asp:GridView ID="gvMovtos2" runat="server" 
            AutoGenerateColumns="False" CellPadding="4"  
            RowStyle-HorizontalAlign="Left" PageSize="300" ForeColor="#333333" GridLines="None">
            <PagerSettings PageButtonCount="20" Position="TopAndBottom" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField HeaderText="UBICACION" DataField="NomUbi" />
                <asp:BoundField HeaderText="ANIMAL" DataField="Animal" />
                <asp:BoundField HeaderText="ID" DataField="animalID" Visible="False" />
                <asp:BoundField HeaderText="NOMBRE" DataField ="NomAni" />
                <asp:BoundField HeaderText="CAPTURA" DataField="f_captura" Visible="False" />
                <asp:BoundField HeaderText="MOVTO" DataField="f_movto" DataFormatString="&quot;{0:d}&quot;" />
                <asp:BoundField HeaderText="GAN/COR" DataField="gan_cor" Visible="False" />
                <asp:BoundField HeaderText="# EMP" DataField="empadre" Visible ="False" />
                <asp:BoundField HeaderText="USUARIO" DataField="usuario" Visible="False" />
                <asp:BoundField HeaderText="ORIGEN DEL MOVTO." DataField="estatus" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="true" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"/>
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:GridView>
        </div>
    
    </div>

    </asp:Panel>

</asp:Content>
